<?php
$table_source = $old_nav_db_config['DB_PREFIX'].'site_cate';
$table_target = $db_config['DB_PREFIX'].'site_cate';

$db_target->query("TRUNCATE $table_target");
$data_list = $db_source->query("SELECT * FROM $table_source");
showjsmessage("开始转换数据表　site_cate",2);
$data_count = count($data_list);
$fields = array_keys($data_list[0]);
$start_sql = "INSERT INTO $table_target ( `" . implode('`, `', $fields) . '` ) VALUES ';

for($j=0; $j< $data_count; $j++)
{
	$record = array_map('dumpEscapeString', $data_list[$j]);//过滤非法字符
	$sql = $start_sql . ' ('. implodeInsertValues($record) .')';
	$db_target->query($sql);
}

showjsmessage("转换数据表　site_cate ... 成功");

showjsmessage(U('Index/convert',array('table'=>'site_rules','begin'=>0)),5);
?>